{extend name="header_admin" /}
{block name="title"}编辑上传策略- {$options.siteName}{/block}
{block name="content"}
<div class="content-wrapper">
  <div class="container-fluid">
    <!-- Breadcrumbs-->
    <ol class="breadcrumb">
      <li class="breadcrumb-item">
        <a href="/Admin">管理面板</a>
      </li>
      <li class="breadcrumb-item">
        <a href="/Admin/PolicyList">上传策略</a>
      </li>
      <li class="breadcrumb-item active">编辑</li>
    </ol>
    
    <!-- Area Chart Example-->
    <div class="row">
      <div class="col-12">
        <h2>编辑上传策略</h2>
        <br>
        {switch name="policy.policy_type"}
         {case value="local"}
        <div class="card" id="local">
          <div class="card-header">
            编辑上传策略
          </div>
          <div class="card-body">
            <form id="Policy">
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                <input type="text" value="{$policy.id}" name="id" style="display: none">
                  <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
                </div>
                <div class="col-md-4"> <input type="text" class="form-control" name="policy_name" value="{$policy.policy_name}" required></div>
                <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="policy_name" class="col-form-label col-form-label-sm">允许获取外链</label>
                </div>
                <div class="col-md-4">
                {eq name="$policy.origin_link" value="1"}
                  <input class="" type="radio" name="origin_link" id="local_allowd_origin1" value="1" checked>
                  <label class="" for="local_allowd_origin1" >允许</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="origin_link" id="local_allowd_origin2" value="0">
                  <label class="" for="local_allowd_origin2">禁止</label>
                {else/}
                  <input class="" type="radio" name="origin_link" id="local_allowd_origin1" value="1" >
                  <label class="" for="local_allowd_origin1" >允许</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="origin_link" id="local_allowd_origin2" value="0" checked>
                  <label class="" for="local_allowd_origin2">禁止</label>
                {/eq}
                </div>
                <div class="col-md-4 option-des"> 是否允许获取文件的源URL，推荐禁止</div>
              </div>
              <div class="row form-setting" id="localOrigin" style="{eq name="$policy.origin_link" value="0"}display:none;{/eq}">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">外链根URL</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="url" value="{$policy.url}">
                </div>
                <div class="col-md-4 option-des"> 一般与主站URL保持相同。如果你设置了融合CDN等产品，这里可以填写CDN域名,结尾要加"/"</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">允许的文件后缀</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="filetype" value="{:getAllowedExt($policy.filetype)}" spellcheck="false">
                </div>
                <div class="col-md-4 option-des"> 多个请以半角逗号","隔开，留空表示不限制。如果允许图片类型文件，除了图片类型后缀外，请额外添加一项"image/*"</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
                </div>
                <div class="col-md-4 input-group mb-3">
                  <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                  <div class="input-group-append">
                    <span class="input-group-text" id="basic-addon2">
                      <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                        <option value="1">B</option>
                        <option value="1024">KB</option>
                        <option value="1048576">MB</option>
                        <option value="1073741824">GB</option>
                      </select>
                    </span>
                  </div>
                  
                </div>
                <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">文件重命名</label>
                </div>
                <div class="col-md-4">
                {eq name="$policy.autoname" value="1"}
                  <input class="" type="radio" name="autoname" id="autoname1" value="1" checked>
                  <label class="" for="autoname1" >开启</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="autoname" id="autoname2" value="0" >
                  <label class="" for="autoname2">关闭</label>
                {else/}
                  <input class="" type="radio" name="autoname" id="autoname1" value="1" >
                  <label class="" for="autoname1" >开启</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="autoname" id="autoname2" value="0" checked>
                  <label class="" for="autoname2" >关闭</label>
                {/eq}
                </div>
                <div class="col-md-4 option-des"> 是否对存储的文件自动重命名。推荐开启，重命名不会影响用户端文件名展示，开启后可以避免文件重名</div>
              </div>
              <div class="row form-setting" id="autoname_form" style=" {eq name="$policy.autoname" value="0"}display:none{/eq}">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">重命名规则</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="namerule" value="{$policy.namerule}" spellcheck="false" required>
                </div>
                <div class="col-md-4 option-des"> 你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTable">变量对照表</a>中的字段填写</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
                </div>
                <div class="col-md-4 input-group mb-3">
                  <div class="input-group-prepend">
                    <span class="input-group-text" id="basic-addon2">
                      /public/uploads/
                    </span>
                  </div>
                  <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
                </div>
                <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
              </div>
              
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                </div>
                <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="savePolicy">保存设置</button></div>
                <div class="col-md-4 option-des"> </div>
                <br> <br>
              </div>
            </form>
          </div>
          <bn>
        </div>
        {/case}
        {case value="qiniu"}
        <div class="card" id="qiniu">
          <div class="card-header">
            编辑上传策略
          </div>
          <div class="card-body">
            <form id="Policy">
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                <input type="text" value="{$policy.id}" name="id" style="display: none">
                  <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
                </div>
                <div class="col-md-4"> <input type="text" class="form-control" name="policy_name" value="{$policy.policy_name}" required></div>
                <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
              </div>
              
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="ak" class="col-form-label col-form-label-sm">AccessKey </label>
                </div>
                <div class="col-md-4"> <input type="text" class="form-control" name="ak"  value="{$policy.ak}" pattern="[^\s]+"  title="请不要包含空格" required></div>
                <div class="col-md-4 option-des"> 七牛账号的AccessKey，请在七牛控制面板查看</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="sk" class="col-form-label col-form-label-sm">SecretKey </label>
                </div>
                <div class="col-md-4"> <input type="text" class="form-control" name="sk" value="{$policy.sk}" pattern="[^\s]+"  title="请不要包含空格" required></div>
                <div class="col-md-4 option-des"> 七牛账号的SecretKey，请在七牛控制面板查看</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="bucketname" class="col-form-label col-form-label-sm">存储空间名称 </label>
                </div>
                <div class="col-md-4"> <input type="text" class="form-control" name="bucketname" value="{$policy.bucketname}" required></div>
                <div class="col-md-4 option-des"> 创建空间时填写的空间名</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="policy_name" class="col-form-label col-form-label-sm">空间属性</label>
                </div>
                <div class="col-md-4">
                {eq name="policy.bucket_private" value="1"}
                  <input class="" type="radio" name="bucket_private" id="bucket_private_1" value="1" checked>
                  <label class="" for="bucket_private_1" >私有空间</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="bucket_private" id="bucket_private_0" value="0">
                  <label class="" for="bucket_private_0">公开空间</label>
                {else/}
                  <input class="" type="radio" name="bucket_private" id="bucket_private_1" value="1">
                  <label class="" for="bucket_private_1" >私有空间</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="bucket_private" id="bucket_private_0" value="0" checked>
                  <label class="" for="bucket_private_0">公开空间</label>
                {/eq}
                </div>
                <div class="col-md-4 option-des"> 与七牛空间访问控制设置保持一致，推荐设置为私有空间</div>
              </div>

              <div class="row form-setting" id="outlink" style="{eq name="policy.bucket_private" value="1"}display:none{/eq}">
                <div class="col-md-1 form-label ">
                  <label for="policy_name" class="col-form-label col-form-label-sm">允许获取外链</label>
                </div>
                <div class="col-md-4">
                 {eq name="policy.origin_link" value="1"}
                  <input class="" type="radio" name="origin_link" id="qiniu_allowd_origin1" value="1" >
                  <label class="" for="qiniu_allowd_origin1" checked>允许</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="origin_link" id="qiniu_allowd_origin2" value="0" >
                  <label class="" for="qiniu_allowd_origin2">禁止</label>
                {else/}
                  <input class="" type="radio" name="origin_link" id="qiniu_allowd_origin1" value="1" >
                  <label class="" for="qiniu_allowd_origin1" >允许</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="origin_link" id="qiniu_allowd_origin2" value="0" checked>
                  <label class="" for="qiniu_allowd_origin2">禁止</label>
                {/eq}
                </div>
                <div class="col-md-4 option-des"> 是否允许获取文件的源URL，推荐禁止</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">空间域名</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="url" value="{$policy.url}" required>
                </div>
                <div class="col-md-4 option-des"> 七牛空间绑定的域名，结尾要加"/"</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">允许的文件后缀</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="filetype" value="{:getAllowedExt($policy.filetype)}" spellcheck="false">
                </div>
                <div class="col-md-4 option-des"> 多个请以半角逗号","隔开，留空表示不限制。如果允许图片类型文件，除了图片类型后缀外，请额外添加一项"image/*"</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="mimetype" class="col-form-label col-form-label-sm">允许的mimeType</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="mimetype" spellcheck="false" value="{$policy.mimetype}">
                </div>
                <div class="col-md-4 option-des"> 多个请以半角分号";"隔开，留空表示不限制。示例：image/*表示只允许上传图片类型，image/jpeg;image/png表示只允许上传jpg和png类型的图片，!application/json;text/plain表示禁止上传json文本和纯文本。注意最前面的感叹号！</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
                </div>
                <div class="col-md-4 input-group mb-3">
                  <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                  <div class="input-group-append">
                    <span class="input-group-text" id="basic-addon2">
                      <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                        <option value="1">B</option>
                        <option value="1024">KB</option>
                        <option value="1048576">MB</option>
                        <option value="1073741824">GB</option>
                      </select>
                    </span>
                  </div>
                </div>
                <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">文件重命名</label>
                </div>
                <div class="col-md-4">
                 {eq name="$policy.autoname" value="1"}
                  <input class="" type="radio" name="autoname" id="autoname1" value="1" checked>
                  <label class="" for="autoname1" >开启</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="autoname" id="autoname2" value="0" >
                  <label class="" for="autoname2">关闭</label>
                {else/}
                  <input class="" type="radio" name="autoname" id="autoname1" value="1" >
                  <label class="" for="autoname1" >开启</label>
                  &nbsp;&nbsp;&nbsp;
                  <input class="" type="radio" name="autoname" id="autoname2" value="0" checked>
                  <label class="" for="autoname2" >关闭</label>
                {/eq}
                </div>
                <div class="col-md-4 option-des"> 是否对存储的文件自动重命名。推荐开启，重命名不会影响用户端文件名展示，开启后可以避免文件重名</div>
              </div>
              <div class="row form-setting" id="autoname_form" style=" {eq name="$policy.autoname" value="0"}display:none{/eq}">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">重命名规则</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="namerule" value="{$policy.namerule}" spellcheck="false" required>
                </div>
                <div class="col-md-4 option-des"> 你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTable">变量对照表</a>中的字段填写</div>
              </div>
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
                </div>
                <div class="col-md-4 input-group mb-3">
           
                  <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
                </div>
                <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
              </div>
              
              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                </div>
                <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="savePolicy">保存设置</button></div>
                <div class="col-md-4 option-des"> </div>
                <br> <br>
              </div>
            </form>
          </div>
          <bn>
        </div>
        {/case}
        {case value="oss"}
        <div id="oss">  

          <div class="card" >
            <div class="card-header">
             编辑上传策略
            </div>
            <div class="card-body">
              <form id="Policy">
    <input type="text" value="{$policy.id}" name="id" style="display: none">
                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
                  </div>
                  <div class="col-md-4"> <input type="text" class="form-control" name="policy_name"  value="{$policy.policy_name}" required></div>
                  <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
                </div>
                
                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="ak" class="col-form-label col-form-label-sm">Access Key ID </label>
                  </div>
                  <div class="col-md-4"> <input type="text" class="form-control" name="ak" pattern="[^\s]+"  title="请不要包含空格" value="{$policy.ak}" required></div>
                  <div class="col-md-4 option-des"> 阿里云账号的Access Key ID，请在阿里云控制面板-Access Key管理中创建或查看</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="sk" class="col-form-label col-form-label-sm"> Access Key Secret </label>
                  </div>
                  <div class="col-md-4"> <input type="text" class="form-control" name="sk" pattern="[^\s]+"  title="请不要包含空格" value="{$policy.sk}" required></div>
                  <div class="col-md-4 option-des"> 获取方法同上一项</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="bucketname" class="col-form-label col-form-label-sm">Bucket名称 </label>
                  </div>
                  <div class="col-md-4"> <input type="text" class="form-control" name="bucketname" value="{$policy.bucketname}" required></div>
                  <div class="col-md-4 option-des"> 创建空间时填写的Bucket名</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="policy_name" class="col-form-label col-form-label-sm">读写权限</label>
                  </div>
                  <div class="col-md-4">
                  {eq name="policy.bucket_private" value="1"}
                    <input class="" type="radio" name="bucket_private" id="oss_private_1" value="1" checked>
                    <label class="" for="oss_private_1" >私有</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="bucket_private" id="oss_private_0" value="0">
                    <label class="" for="oss_private_0">公共读</label>
                  {else/}
                    <input class="" type="radio" name="bucket_private" id="oss_private_1" value="1">
                    <label class="" for="oss_private_1" >私有</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="bucket_private" id="oss_private_0" value="0" checked>
                    <label class="" for="oss_private_0">公共读</label>
                  {/eq}
                  </div>
                  <div class="col-md-4 option-des"> 与OSS空间访问控制设置保持一致，推荐设置为私有空间</div>
                </div>

                <div class="row form-setting" id="oss_outlink" style="{eq name="policy.bucket_private" value="1"}display:none{/eq}">
                  <div class="col-md-1 form-label ">
                    <label for="policy_name" class="col-form-label col-form-label-sm">允许获取外链</label>
                  </div>
                  <div class="col-md-4">
                  {eq name="policy.origin_link" value="0"}
                    <input class="" type="radio" name="origin_link" id="oss_allowd_origin1" value="1" >
                    <label class="" for="oss_allowd_origin1" >允许</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="origin_link" id="oss_allowd_origin2" value="0" checked>
                    <label class="" for="oss_allowd_origin2">禁止</label>
                  {else/}
                    <input class="" type="radio" name="origin_link" id="oss_allowd_origin1" value="1" checked>
                    <label class="" for="oss_allowd_origin1" >允许</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="origin_link" id="oss_allowd_origin2" value="0">
                    <label class="" for="oss_allowd_origin2">禁止</label>
                  {/eq}
                  </div>
                  <div class="col-md-4 option-des"> 是否允许获取文件的源URL，推荐禁止</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="url" class="col-form-label col-form-label-sm">空间域名</label>
                  </div>
                  <div class="col-md-4">
                    <input type="text" class="form-control" name="url" value="{$policy.url}" required>
                  </div>
                  <div class="col-md-4 option-des"> OSS空间绑定的域名，用于文件下载、访问，结尾要加"/"（推荐配合阿里云CDN使用，此处填写CDN域名）</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="server" class="col-form-label col-form-label-sm">上传域名</label>
                  </div>
                  <div class="col-md-4">
                    <input type="text" class="form-control" name="server" value="{$policy.server}" required>
                  </div>
                  <div class="col-md-4 option-des"> OSS空间的域名，一般与上一项保持一致。（如果上一项填写的是CDN域名，则此处与上一项不应相同）</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="filetype" class="col-form-label col-form-label-sm">允许的文件后缀</label>
                  </div>
                  <div class="col-md-4">
                    <input type="text" class="form-control" name="filetype" value="{:getAllowedExt($policy.filetype)}" spellcheck="false">
                  </div>
                  <div class="col-md-4 option-des"> 多个请以半角逗号","隔开，留空表示不限制。如果允许图片类型文件，除了图片类型后缀外，请额外添加一项"image/*"</div>
                </div>

                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
                  </div>
                  <div class="col-md-4 input-group mb-3">
                    <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                    <div class="input-group-append">
                      <span class="input-group-text" id="basic-addon2">
                        <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                          <option value="1">B</option>
                          <option value="1024">KB</option>
                          <option value="1048576">MB</option>
                          <option value="1073741824">GB</option>
                        </select>
                      </span>
                    </div>
                  </div>
                  <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
                </div>
                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="filetype" class="col-form-label col-form-label-sm">文件重命名</label>
                  </div>
                  <div class="col-md-4">
                    {eq name="policy.autoname" value="1"}
                    <input class="" type="radio" name="autoname" id="oss_autoname1" value="1" checked>
                    <label class="" for="oss_autoname1" >开启</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="autoname" id="oss_autoname2" value="0" >
                    <label class="" for="oss_autoname2">关闭</label>
                  {else/}
                    <input class="" type="radio" name="autoname" id="oss_autoname1" value="1" >
                    <label class="" for="oss_autoname1" >开启</label>
                    &nbsp;&nbsp;&nbsp;
                    <input class="" type="radio" name="autoname" id="oss_autoname2" value="0" checked>
                    <label class="" for="oss_autoname2">关闭</label>
                  {/eq}
                  </div>
                  <div class="col-md-4 option-des"> 是否对存储的文件自动重命名。推荐开启，重命名不会影响用户端文件名展示，开启后可以避免文件重名</div>
                </div>
                <div class="row form-setting" id="oss_autoname_form" style="{eq name="policy.autoname" value="0"}display:none{/eq}">
                  <div class="col-md-1 form-label ">
                    <label for="url" class="col-form-label col-form-label-sm">重命名规则</label>
                  </div>
                  <div class="col-md-4">
                    <input type="text" class="form-control" name="namerule" value="{$policy.namerule}" spellcheck="false" required>
                  </div>
                  <div class="col-md-4 option-des"> 你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTable">变量对照表</a>中的字段填写</div>
                </div>
                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                    <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
                  </div>
                  <div class="col-md-4 input-group mb-3">
             
                    <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
                  </div>
                  <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
                </div>
                
                <div class="row form-setting">
                  <div class="col-md-1 form-label ">
                  </div>
                  <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="savePolicy">保存设置</button></div>
                  <div class="col-md-4 option-des"> </div>
                  <br> <br>
                </div>
              </form>
            </div>
            <bn>
          </div>
        </div>
{/case}
       {case value="upyun"}
       <div class="card" id="upyun">
         <div class="card-header">
           又拍云
         </div>
         <div class="card-body">
           <form id="Policy">
              <input type="text" value="{$policy.id}" name="id" style="display: none">
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="policy_name"  value="{$policy.policy_name}" required></div>
               <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
             </div>
             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="ak" class="col-form-label col-form-label-sm">操作员名称 </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="op_name"  value="{$policy.op_name}" required></div>
               <div class="col-md-4 option-des"> 创建存储服务时授权的操作员名称</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="sk" class="col-form-label col-form-label-sm">操作员密码 </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="op_pwd" value="{$policy.op_pwd}" required></div>
               <div class="col-md-4 option-des"> 创建存储服务时授权的操作员密码</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="bucketname" class="col-form-label col-form-label-sm">存储服务名 </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="bucketname" value="{$policy.bucketname}" required></div>
               <div class="col-md-4 option-des"> 创建存储服务时填写的名称</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">Token 防盗链</label>
               </div>
               <div class="col-md-4">
               {eq name="policy.bucket_private" value="1"}
                 <input class="" type="radio" name="bucket_private" id="upyun_bucket_private_1" value="1" checked>
                 <label class="" for="upyun_bucket_private_1" >开启</label>
                 &nbsp;&nbsp;&nbsp;
                 <input class="" type="radio" name="bucket_private" id="upyun_bucket_private_0" value="0">
                 <label class="" for="upyun_bucket_private_0">关闭</label>
              {else/}
                <input class="" type="radio" name="bucket_private" id="upyun_bucket_private_1" value="1">
                <label class="" for="upyun_bucket_private_1" >开启</label>
                &nbsp;&nbsp;&nbsp;
                <input class="" type="radio" name="bucket_private" id="upyun_bucket_private_0" value="0" checked>
                <label class="" for="upyun_bucket_private_0">关闭</label>
              {/eq}
               </div>
               <div class="col-md-4 option-des"> 与 功能配置-访问配置-Token 防盗链 保持一致，推荐设置为开启</div>
             </div>

             <div class="row form-setting" id="upyun_token" style="{eq name="policy.bucket_private" value="0"}display:none{/eq}">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">防盗链密钥</label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="sk" value="{$policy.sk}"></div>
               <div class="col-md-4 option-des"> 与 功能配置-访问配置-Token防盗链 中的密钥保持一致</div>
             </div>

             <div class="row form-setting" id="upyun_outlink" style="{eq name="policy.bucket_private" value="1"}display:none{/eq}">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">允许获取外链</label>
               </div>
               <div class="col-md-4">
              {eq name="policy.origin_link" value="0"}
                 <input class="" type="radio" name="origin_link" id="upyun_allowd_origin1" value="1" >
                 <label class="" for="upyun_allowd_origin1" >允许</label>
                 &nbsp;&nbsp;&nbsp;
                 <input class="" type="radio" name="origin_link" id="upyun_allowd_origin2" value="0" checked>
                 <label class="" for="upyun_allowd_origin2">禁止</label>
              {else/}
                <input class="" type="radio" name="origin_link" id="upyun_allowd_origin1" value="1" checked>
                <label class="" for="upyun_allowd_origin1" >允许</label>
                &nbsp;&nbsp;&nbsp;
                <input class="" type="radio" name="origin_link" id="upyun_allowd_origin2" value="0" >
                <label class="" for="upyun_allowd_origin2">禁止</label>
              {/eq}
               </div>
               <div class="col-md-4 option-des"> 是否允许获取文件的源URL，推荐禁止</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">空间域名</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="url" value="{$policy.url}" required>
               </div>
               <div class="col-md-4 option-des"> 绑定的域名，开头要加http(s)://结尾要加"/"</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">允许的文件后缀</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="filetype" value="{:getAllowedExt($policy.filetype)}" spellcheck="false">
               </div>
               <div class="col-md-4 option-des"> 多个请以半角逗号","隔开，留空表示不限制。如果允许图片类型文件，除了图片类型后缀外，请额外添加一项"image/*"</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
               </div>
               <div class="col-md-4 input-group mb-3">
                 <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                 <div class="input-group-append">
                   <span class="input-group-text" id="basic-addon2">
                     <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                       <option value="1">B</option>
                       <option value="1024">KB</option>
                       <option value="1048576">MB</option>
                       <option value="1073741824">GB</option>
                     </select>
                   </span>
                 </div>
               </div>
               <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
             </div>
             <input type="text" name="autoname" value="1" style="display: none">
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
               </div>
               <div class="col-md-4 input-group mb-3">
          
                 <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
               </div>
               <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
             </div>
             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
               </div>
               <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="saveUpyun">保存设置</button></div>
               <div class="col-md-4 option-des"> </div>
               <br> <br>
             </div>
           </form>
         </div>
         <bn>
       </div>
       {/case}
       {case value="s3"}
       <div class="card" id="s3" >
         <div class="card-header">
           编辑S3上传策略
         </div>
         <div class="card-body">
           <form id="Policy">
             <input type="text" value="{$policy.id}" name="id" style="display: none">
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" value="{$policy.policy_name}" name="policy_name" required></div>
               <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
             </div>
             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="ak" class="col-form-label col-form-label-sm">AWSAccessKeyId </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="ak" value="{$policy.ak}" required></div>
               <div class="col-md-4 option-des"> AWS账户的访问秘钥信息，请在 控制面板 - 您的安全凭证 中创建</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="sk" class="col-form-label col-form-label-sm">AWSSecretKey </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" value="{$policy.sk}" name="sk" required></div>
               <div class="col-md-4 option-des"> 同上一项获取</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="bucketname" class="col-form-label col-form-label-sm">存储桶名称 </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" value="{$policy.bucketname}" name="bucketname" required></div>
               <div class="col-md-4 option-des"> 创建桶时填写的名称</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">下载根URL</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="url" value="{$policy.url}" required>
               </div>
               <div class="col-md-4 option-des"> 一般格式为：https://s3-分区名.amazonaws.com/储存桶名/ 结尾要加"/"</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">上传服务器URL</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="server" value="{$policy.server}" required>
               </div>
               <div class="col-md-4 option-des"> 一般格式为：https://储存桶名.s3-分区代号.amazonaws.com/</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">储存区域</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" value="{$policy.op_name}" name="op_name" required>
               </div>
               <div class="col-md-4 option-des"> 例如：ap-southeast-1</div>
             </div>
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">EndPoint</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="op_pwd" value="{$policy.op_pwd}"  required>
               </div>
               <div class="col-md-4 option-des"> 一般格式为：s3-储存区域.amazonaws.com，只填写域名部分</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">允许的文件后缀</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="filetype" value="{:getAllowedExt($policy.filetype)}" spellcheck="false">
               </div>
               <div class="col-md-4 option-des"> 多个请以半角逗号","隔开，留空表示不限制。如果允许图片类型文件，除了图片类型后缀外，请额外添加一项"image/*"</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
               </div>
               <div class="col-md-4 input-group mb-3">
                 <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                 <div class="input-group-append">
                   <span class="input-group-text" id="basic-addon2">
                     <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                       <option value="1">B</option>
                       <option value="1024">KB</option>
                       <option value="1048576" >MB</option>
                       <option value="1073741824">GB</option>
                     </select>
                   </span>
                 </div>
               </div>
               <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
             </div>

             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
               </div>
               <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="savePolicy">保存设置</button></div>
               <div class="col-md-4 option-des"> </div>
               <br> <br>
             </div>
           </form>
         </div>
         <bn>
       </div>

       {/case}
       {case value="remote"}
       <div class="card" id="remote" >
         <div class="card-header">
           编辑远程上传策略
         </div>
         <div class="card-body">
           <form id="Policy">
             <input type="text" value="{$policy.id}" name="id" style="display: none">
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" value="{$policy.policy_name}" name="policy_name" required></div>
               <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
             </div>
             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="ak" class="col-form-label col-form-label-sm">AccessToken </label>
               </div>
               <div class="col-md-4"> <input type="text" class="form-control" name="sk" value="{$policy.sk}" required></div>
               <div class="col-md-4 option-des"> 默认随机生成，请与远程服务端配置文件中保持一致</div>
             </div>

           <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">服务端URL</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="server" value="{$policy.server}" required>
                </div>
                <div class="col-md-4 option-des"> 结尾要加"/"</div>
              </div>

              <div class="row form-setting">
                <div class="col-md-1 form-label ">
                  <label for="url" class="col-form-label col-form-label-sm">下载根URL</label>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" name="url" value="{$policy.url}" required>
                </div>
                <div class="col-md-4 option-des"> 一般与上一步保持一致，结尾要加"/"</div>
              </div>



             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
               </div>
               <div class="col-md-4 input-group mb-3">
                 <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                 <div class="input-group-append">
                   <span class="input-group-text" id="basic-addon2">
                     <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                       <option value="1">B</option>
                       <option value="1024">KB</option>
                       <option value="1048576" >MB</option>
                       <option value="1073741824">GB</option>
                     </select>
                   </span>
                 </div>
               </div>
               <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
             </div>

             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">文件重命名</label>
               </div>
               <div class="col-md-4">
               {eq name="$policy.autoname" value="1"}
                 <input class="" type="radio" name="autoname" id="autoname1" value="1" checked>
                 <label class="" for="autoname1" >开启</label>
                 &nbsp;&nbsp;&nbsp;
                 <input class="" type="radio" name="autoname" id="autoname2" value="0" >
                 <label class="" for="autoname2">关闭</label>
               {else/}
                 <input class="" type="radio" name="autoname" id="autoname1" value="1" >
                 <label class="" for="autoname1" >开启</label>
                 &nbsp;&nbsp;&nbsp;
                 <input class="" type="radio" name="autoname" id="autoname2" value="0" checked>
                 <label class="" for="autoname2" >关闭</label>
               {/eq}
               </div>
               <div class="col-md-4 option-des"> 是否对存储的文件自动重命名。推荐开启，重命名不会影响用户端文件名展示，开启后可以避免文件重名</div>
             </div>
             <div class="row form-setting" id="autoname_form" style=" {eq name="$policy.autoname" value="0"}display:none{/eq}">
               <div class="col-md-1 form-label ">
                 <label for="url" class="col-form-label col-form-label-sm">重命名规则</label>
               </div>
               <div class="col-md-4">
                 <input type="text" class="form-control" name="namerule" value="{$policy.namerule}" spellcheck="false" required>
               </div>
               <div class="col-md-4 option-des"> 你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTable">变量对照表</a>中的字段填写</div>
             </div>
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
                 <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
               </div>
               <div class="col-md-4 input-group mb-3">
                 <div class="input-group-prepend">
                   <span class="input-group-text" id="basic-addon2">
                     /public/uploads/
                   </span>
                 </div>
                 <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
               </div>
               <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
             </div>
             
             <div class="row form-setting">
               <div class="col-md-1 form-label ">
               </div>
               <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="savePolicy">保存设置</button></div>
               <div class="col-md-4 option-des"> </div>
               <br> <br>
             </div>
           </form>
         </div>
         <bn>
       </div>

       {/case}
       {case value="onedrive"}
       <div class="alert alert-warning" role="alert">
        <strong>添加Onedrive上传策略前请确保阅读完下面内容！</strong>
        <ul>
        <li>Onedrive策略无法直传，上传文件时，Cloudreve会先将文件暂存在服务器，之后再由任务队列上传至Onedrive；</li>
        <li>使用本策略前，请先配置并运行<a href="https://github.com/HFO4/Cloudreve/wiki/Onedrive%E5%AF%B9%E6%8E%A5%E8%AF%B4%E6%98%8E">Cloudreve任务队列</a>,否则正常无法使用;</li>
        <li>用户上传文件后不能立马看到所上传的文件，需要等待任务队列处理完毕；</li>
        <li>请确保已经正确配置好Cloudreve的Cron定时任务，以便用于刷新AccessToken信息。</li>
        </ul>
      </div>
      <div class="card" id="s3" >
        <div class="card-header">
          添加Onedrive上传策略
        </div>
        <div class="card-body">
          <form id="Policy">
            <input type="text" value="{$policy.id}" name="id" style="display: none">
            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="policy_name" class="col-form-label col-form-label-sm">上传策略名称</label>
              </div>
              <div class="col-md-4"> <input type="text" class="form-control" value="{$policy.policy_name}" name="policy_name" required></div>
              <div class="col-md-4 option-des"> 上传策略的名称，用于区别不同策略</div>
            </div>
            
            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="bucketname" class="col-form-label col-form-label-sm">应用 ID（Client ID） </label>
              </div>
              <div class="col-md-4"> <input type="text" class="form-control" name="bucketname" value="{$policy.bucketname}" required></div>
              <div class="col-md-4 option-des"> 请<a href="https://apps.dev.microsoft.com/?referrer=https%3a%2f%2fdeveloper.microsoft.com%2fzh-CN%2fgraph%2fquick-start#/quickstart/graphIO?publicClientSupport=false&appName=Cloudreve&redirectUrl={:urlencode($options.siteURL)}Admin%2FoneDriveCalllback&allowImplicitFlow=false&ru=https:%2F%2Fdeveloper.microsoft.com%2Fzh-CN%2Fgraph%2Fquick-start%3FappID%3D_appId_%26appName%3D_appName_%26redirectUrl%3D{$options.siteURL}Admin/oneDriveCalllback%26platform%3Doption-php" target="_blank">点击这里</a>获取下一步要用到的应用机密和此处的应用ID</div>
            </div>


            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="url" class="col-form-label col-form-label-sm">应用机密(密码/公钥)</label>
              </div>
              <div class="col-md-4">
                <input type="text" class="form-control" name="ak" value="{$policy.ak}" required>
              </div>
              <div class="col-md-4 option-des"> 同上一项一起获取</div>
            </div>

            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="filetype" class="col-form-label col-form-label-sm">单文件最大大小</label>
              </div>
              <div class="col-md-4 input-group mb-3">
                <input type="number" class="form-control" name="max_size"  spellcheck="false" min="0" value="{:countSize($policy.max_size,true)[0]}" required>
                <div class="input-group-append">
                  <span class="input-group-text" id="basic-addon2">
                    <select name="sizeTimes" class="selectIn" data-value="{:countSize($policy.max_size,true)[1]}">
                      <option value="1">B</option>
                      <option value="1024">KB</option>
                      <option value="1048576" >MB</option>
                      <option value="1073741824">GB</option>
                    </select>
                  </span>
                </div>
              </div>
              <div class="col-md-4 option-des"> 允许上传的单个文件的最大尺寸</div>
            </div>

            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="filetype" class="col-form-label col-form-label-sm">文件重命名</label>
              </div>
              <div class="col-md-4">
              {eq name="$policy.autoname" value="1"}
                <input class="" type="radio" name="autoname" id="autoname1" value="1" checked>
                <label class="" for="autoname1" >开启</label>
                &nbsp;&nbsp;&nbsp;
                <input class="" type="radio" name="autoname" id="autoname2" value="0" >
                <label class="" for="autoname2">关闭</label>
              {else/}
                <input class="" type="radio" name="autoname" id="autoname1" value="1" >
                <label class="" for="autoname1" >开启</label>
                &nbsp;&nbsp;&nbsp;
                <input class="" type="radio" name="autoname" id="autoname2" value="0" checked>
                <label class="" for="autoname2" >关闭</label>
              {/eq}
              </div>
              <div class="col-md-4 option-des"> 是否对存储的文件自动重命名。推荐开启，重命名不会影响用户端文件名展示，开启后可以避免文件重名</div>
            </div>
            <div class="row form-setting" id="autoname_form" style=" {eq name="$policy.autoname" value="0"}display:none{/eq}">
              <div class="col-md-1 form-label ">
                <label for="url" class="col-form-label col-form-label-sm">重命名规则</label>
              </div>
              <div class="col-md-4">
                <input type="text" class="form-control" name="namerule" value="{$policy.namerule}" spellcheck="false" required>
              </div>
              <div class="col-md-4 option-des"> 你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTable">变量对照表</a>中的字段填写</div>
            </div>
            <div class="row form-setting">
              <div class="col-md-1 form-label ">
                <label for="filetype" class="col-form-label col-form-label-sm">存储目录</label>
              </div>
              <div class="col-md-4 input-group mb-3">
                <div class="input-group-prepend">
                  <span class="input-group-text" id="basic-addon2">
                    Onedrive根目录/
                  </span>
                </div>
                <input type="text" class="form-control" name="dirrule"  spellcheck="false" value="{$policy.dirrule}" required>
              </div>
              <div class="col-md-4 option-des"> 文件存放的目录，你可以使用<a href="javascript:void()" data-toggle="modal" data-target="#varTableFolder">目录变量对照表</a>中的字段填写</div>
            </div>

            
            <div class="row form-setting">
              <div class="col-md-1 form-label ">
              </div>
              <div class="col-md-4"> <button type="submit" class="btn btn-primary" id="saveQiniu">保存</button> <a  class="btn btn-danger" href="/Admin/UpdateOnedriveToken?id={$policy.id}" id="saveQiniu">重新授权账号(请先保存)</a></div>
              <div class="col-md-4 option-des"> </div>
              <br> <br>
            </div>
          </form>
        </div>
        <bn>
      </div>
       {/case}
{/switch}
        <br>
      </div>
    </div>
    
    <!-- Example DataTables Card-->
  </div>
  <!-- /.container-fluid-->
</div>
<!-- /.content-wrapper-->
<div class="modal fade" tabindex="-1" role="dialog" id="varTable">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">自动重命名变量对照表</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="table-responsive">
          <table class="table">
            <thead>
              <tr>
                <th >变量字段</th>
                <th >说明</th>
                <th >示例</th>
                <th >适用范围</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td >{date}</td>
                <td>上传日期</td>
                <td>20180118</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{datetime}</td>
                <td>上传日期时间</td>
                <td>20180118121049</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{uid}</td>
                <td>上传者UID</td>
                <td>154</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{timestamp}</td>
                <td>时间戳</td>
                <td>1516277624</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{randomkey16}</td>
                <td>16位随机字符</td>
                <td>16D8lhjErTDWAQjW</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{randomkey8}</td>
                <td>8位随机字符</td>
                <td>hM4Tpdh6</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{originname}</td>
                <td>原始文件名</td>
                <td>plus1s.jpg</td>
                <td>全部</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="varTableFolder">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">目录变量对照表</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="table-responsive">
          <table class="table">
            <thead>
              <tr>
                <th >变量字段</th>
                <th >说明</th>
                <th >示例</th>
                <th >适用范围</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td >{date}</td>
                <td>上传日期</td>
                <td>20180118</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{datetime}</td>
                <td>上传日期时间</td>
                <td>20180118121049</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{uid}</td>
                <td>上传者UID</td>
                <td>154</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{timestamp}</td>
                <td>时间戳</td>
                <td>1516277624</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{randomkey16}</td>
                <td>16位随机字符</td>
                <td>16D8lhjErTDWAQjW</td>
                <td>全部</td>
              </tr>
              <tr>
                <td >{randomkey8}</td>
                <td>8位随机字符</td>
                <td>hM4Tpdh6</td>
                <td>全部</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
{/block}
{block name="js"}
<script src="/static/js/admin/edit_policy.js"></script>
<script type="text/javascript">
</script>
{/block}